home *** CD-ROM | disk | FTP | other *** search
/ BUG 1 / BUGCD1996_0708.ISO / pc / util / minilin / minilin.exe / USR / X11.{__ / BIN / STARTX < prev    next >
Text File  |  1993-10-20  |  2KB  |  94 lines

  1. #!/bin/sh
  2.  
  3. # $XFree86: mit/clients/xinit/startx.cpp,v 2.0 1993/10/13 15:49:15 dawes Exp $
  4. # $XConsortium: startx.cpp,v 1.4 91/08/22 11:41:29 rws Exp $
  5. # This is just a sample implementation of a slightly less primitive 
  6. # interface than xinit.  It looks for user .xinitrc and .xserverrc
  7. # files, then system xinitrc and xserverrc files, else lets xinit choose
  8. # its default.  The system xinitrc should probably do things like check
  9. # for .Xresources files and merge them in, startup up a window manager,
  10. # and pop a clock and serveral xterms.
  11. #
  12. # Site administrators are STRONGLY urged to write nicer versions.
  13.  
  14. userclientrc=$HOME/.xinitrc
  15. userserverrc=$HOME/.xserverrc
  16. if [ x"$XWINHOME" != x ]; then
  17.     if [ x"$XWINHOME" = x/usr ]; then
  18.         BIN_DIR=/usr/bin/X11
  19.     else
  20.         BIN_DIR=$XWINHOME/bin
  21.     fi
  22.     XINIT_DIR=$XWINHOME/lib/X11/xinit
  23. else
  24.     BIN_DIR=/usr/X386/bin
  25.     XINIT_DIR=/usr/X386/lib/X11/xinit
  26. fi
  27. sysclientrc=$XINIT_DIR/xinitrc
  28. sysserverrc=$XINIT_DIR/xserverrc
  29. clientargs=""
  30. serverargs=""
  31.  
  32. if [ -f $userclientrc ]; then
  33.     clientargs=$userclientrc
  34. else if [ -f $sysclientrc ]; then
  35.     clientargs=$sysclientrc
  36. fi
  37. fi
  38.  
  39. if [ -f $userserverrc ]; then
  40.     serverargs=$userserverrc
  41. else if [ -f $sysserverrc ]; then
  42.     serverargs=$sysserverrc
  43. fi
  44. fi
  45.  
  46. whoseargs="client"
  47. have_server=0
  48. while [ "x$1" != "x" ]; do
  49.     case "$1" in
  50.     /''*|\.*)    if [ "$whoseargs" = "client" ]; then
  51.             clientargs="$1"
  52.         else
  53.             serverargs="$1"
  54.             have_server=1
  55.         fi ;;
  56.     --)    whoseargs="server" ;;
  57.     *)    if [ "$whoseargs" = "client" ]; then
  58.             clientargs="$clientargs $1"
  59.         else
  60.             if [ "$have_server" = 0 ]; then
  61.             if [ -x $BIN_DIR/"$1" ]; then
  62.                 serverargs=$BIN_DIR/"$1"
  63.                 have_server=1
  64.             else
  65.                 serverargs="$serverargs $1"
  66.             fi
  67.             else
  68.                 serverargs="$serverargs $1"
  69.             fi
  70.         fi ;;
  71.     esac
  72.     shift
  73. done
  74.  
  75. xinit $clientargs -- $serverargs
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.